package com.jingtai.platform.controller.merchants;

import com.jingtai.core.entity.merchants.MerchantsToMemberOrder;
import com.jingtai.platform.service.merchants.MerchantsToMemberOrderService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 商品订单总表（用户对商户）
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/merchantstomemberorder")
@Api(tags = "商品订单总表（用户对商户）")
public class MerchantsToMemberOrderController{

    @Autowired
    private MerchantsToMemberOrderService merchantsToMemberOrderService;


    @ApiOperation("商品订单总表（用户对商户）列表查询")
    @GetMapping("/list")
    public ResultUtil aopMerchantsToMemberOrderList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return merchantsToMemberOrderService.MerchantsToMemberOrderlist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询merchantsToMemberOrder实体")
    @GetMapping("/getMerchantsToMemberOrderById")
    public ResultUtil GetMerchantsToMemberOrderById(@CApiParam(name = "id",value = "merchantsToMemberOrder实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsToMemberOrderService.getMerchantsToMemberOrderById(id);
    }


    @ApiOperation("新增merchantsToMemberOrder实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"merchantsToMemberOrder.id","merchantsToMemberOrder.createTime","merchantsToMemberOrder.updateTime","merchantsToMemberOrder.deleteFlag"})
    public ResultUtil aopAddMerchantsToMemberOrder(@RequestBody @Validated MerchantsToMemberOrder merchantsToMemberOrder){
        return merchantsToMemberOrderService.addMerchantsToMemberOrder(merchantsToMemberOrder);
    }

    @ApiOperation("编辑merchantsToMemberOrder实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"merchantsToMemberOrder.createTime","merchantsToMemberOrder.updateTime","merchantsToMemberOrder.deleteFlag"})
    public ResultUtil aopEditMerchantsToMemberOrder(@RequestBody @Validated MerchantsToMemberOrder merchantsToMemberOrder){
        return merchantsToMemberOrderService.editMerchantsToMemberOrder(merchantsToMemberOrder);
    }

    @ApiOperation("根据ID删除merchantsToMemberOrder实体")
    @GetMapping("/delMerchantsToMemberOrderById")
    public ResultUtil aopDelMerchantsToMemberOrderById(@CApiParam(name = "id",value = "merchantsToMemberOrder实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsToMemberOrderService.delMerchantsToMemberOrderById(id);
    }

}






